The internal combustion engine may include a variable valve mechanism that varies actuation parameters of engine valves such as intake valves or exhaust valves. The variable valve mechanism is driven by, for example, a motor rotating in a set angular range. In other words, current values representing the valve actuation parameters correspond to the motor rotational angle. Accordingly, in order to accurately control the valve actuation parameters, it is important to accurately detect and control the motor rotational angle.
Patent Document 1 discloses a motor rotational angle detection device. A position sensor, which is, for example, an encoder, detects a pulse signal when a motor rotates. A position counter counts the pulse signal and obtains a counter value. The motor rotational angle is detected based on the counter value.    Patent Document 1: Japanese Laid-Open Patent Publication No. 2004-76265